# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AlertCenter.V1beta1.Model.SensitiveAdminAction do
  @moduledoc """
  Alert that is triggered when Sensitive Admin Action occur in customer account.

  ## Attributes

  *   `actorEmail` (*type:* `String.t`, *default:* `nil`) - Email of person who performed the action
  *   `eventTime` (*type:* `DateTime.t`, *default:* `nil`) - The time at which event occurred
  *   `primaryAdminChangedEvent` (*type:* `GoogleApi.AlertCenter.V1beta1.Model.PrimaryAdminChangedEvent.t`, *default:* `nil`) - Event occurred when primary admin changed in customer's account
  *   `ssoProfileCreatedEvent` (*type:* `GoogleApi.AlertCenter.V1beta1.Model.SSOProfileCreatedEvent.t`, *default:* `nil`) - Event occurred when SSO Profile created in customer's account
  *   `ssoProfileDeletedEvent` (*type:* `GoogleApi.AlertCenter.V1beta1.Model.SSOProfileDeletedEvent.t`, *default:* `nil`) - Event occurred when SSO Profile deleted in customer's account
  *   `ssoProfileUpdatedEvent` (*type:* `GoogleApi.AlertCenter.V1beta1.Model.SSOProfileUpdatedEvent.t`, *default:* `nil`) - Event occurred when SSO Profile updated in customer's account
  *   `superAdminPasswordResetEvent` (*type:* `GoogleApi.AlertCenter.V1beta1.Model.SuperAdminPasswordResetEvent.t`, *default:* `nil`) - Event occurred when password was reset for super admin in customer's account
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :actorEmail => String.t() | nil,
          :eventTime => DateTime.t() | nil,
          :primaryAdminChangedEvent =>
            GoogleApi.AlertCenter.V1beta1.Model.PrimaryAdminChangedEvent.t() | nil,
          :ssoProfileCreatedEvent =>
            GoogleApi.AlertCenter.V1beta1.Model.SSOProfileCreatedEvent.t() | nil,
          :ssoProfileDeletedEvent =>
            GoogleApi.AlertCenter.V1beta1.Model.SSOProfileDeletedEvent.t() | nil,
          :ssoProfileUpdatedEvent =>
            GoogleApi.AlertCenter.V1beta1.Model.SSOProfileUpdatedEvent.t() | nil,
          :superAdminPasswordResetEvent =>
            GoogleApi.AlertCenter.V1beta1.Model.SuperAdminPasswordResetEvent.t() | nil
        }

  field(:actorEmail)
  field(:eventTime, as: DateTime)

  field(:primaryAdminChangedEvent,
    as: GoogleApi.AlertCenter.V1beta1.Model.PrimaryAdminChangedEvent
  )

  field(:ssoProfileCreatedEvent, as: GoogleApi.AlertCenter.V1beta1.Model.SSOProfileCreatedEvent)
  field(:ssoProfileDeletedEvent, as: GoogleApi.AlertCenter.V1beta1.Model.SSOProfileDeletedEvent)
  field(:ssoProfileUpdatedEvent, as: GoogleApi.AlertCenter.V1beta1.Model.SSOProfileUpdatedEvent)

  field(:superAdminPasswordResetEvent,
    as: GoogleApi.AlertCenter.V1beta1.Model.SuperAdminPasswordResetEvent
  )
end

defimpl Poison.Decoder, for: GoogleApi.AlertCenter.V1beta1.Model.SensitiveAdminAction do
  def decode(value, options) do
    GoogleApi.AlertCenter.V1beta1.Model.SensitiveAdminAction.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AlertCenter.V1beta1.Model.SensitiveAdminAction do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
